import { createRouter, createWebHistory } from 'vue-router'


const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      redirect: '/login'
    },
    {
      path: '/login',
      component: () => import('@/views/UserLogin.vue')
    },
    {
      path: '/register',
      component: () => import('@/views/UserRegister.vue')
    },
    {
      path: '/main',
      component: () => import('@/views/MainView.vue'),
      redirect: '/information',
      children: [
        {
          path: '/information',
          component: () => import('@/views/InformationView.vue')
        },
        {
          path: '/addChart',
          component: () => import('@/views/AddChart.vue')
        },
        {
          path: '/mychart',
          component: () => import('@/views/MyChart.vue')
        }
      ]
    }
  ],
})
export default router
